Skip to content

Conversation

@UnderKoen
Copy link

Implement #22

'regex/invalid-use-body-annotation': [
  'error',
  [
    {
      regex: `(?<!(?:static|private|protected|function)(?: |\\w)*)(\\w+\\()(\\s*(?!@Body)\\w+:)`,
      message:
        'Please use @Body() only in controllers. Or make function static / protected.',
      id: 'use-body-annotation',
      suggestions: [
        {
          message: 'Add @Body() annotation',
          replacement: {
            function: "return $[1]+'@Body()'+$[2]",
          },
        },
      ],
    },
  ],
],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant